<?php
/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	mod_stats
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

$session = JFactory::getSession();
$locationId = $session->get('location');
?>
<script type="text/javascript">
<!--
	jQuery().ready(function($){
		$('#location').change(function(){
			location.href="<?php echo JRoute::_('index.php?option=com_je_product&task=post.changeLocation&id=', false); ?>"+$(this).val();

			return;
		});
	});
//-->
</script>

<select class="je-location-module<?php echo $moduleclass_sfx ?>" id="location">
	<option value="*">Toàn Quốc</option>
<?php foreach ($list as $item) : ?>
	<?php $selected = ($item->id == $locationId) ? 'selected="selected"' : null; ?>
	<option value="<?php echo $item->id; ?>" <?php echo $selected; ?>><?php echo $item->name;?></option>
<?php endforeach; ?>
</select>